import request from '@/utils/request.js'

// 查询消息列表
export function listMessage(query) {
  return request.get('/app/message/list', query)
}

// 查询未读消息数量
export function getUnreadCount() {
  return request.get('/app/message/unread')
}

// 标记消息为已读
export function markAsRead(messageId) {
  return request.put(`/app/message/${messageId}/read`)
}

// 标记所有消息为已读
export function markAllAsRead() {
  return request.put('/app/message/read/all')
}

// 删除消息
export function deleteMessage(messageId) {
  return request.delete(`/app/message/${messageId}`)
}

// 清空所有消息
export function clearAllMessages() {
  return request.delete('/app/message/clear')
}